package com.sam.apppreferenceedit

import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.sam.library.document.DocumentActivity

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val sp = getSharedPreferences("test3", Context.MODE_PRIVATE)
        sp.edit().putInt("a", 100).apply()
        sp.edit().putString("b", "dafdafafaeadfa").apply()
        sp.edit().putBoolean("c", true).apply()
        sp.edit().putFloat("d", 908.6766f).apply()
        val arr = setOf<String>("a", "b", "cc,cc", "eeee", "dd,dd")
        sp.edit().putStringSet("e", arr).apply()
        window.decorView.post {
            startActivity(Intent(this@MainActivity, DocumentActivity::class.java))
        }
    }
}